import { Post } from "@/library/utils/request";

/**
 * 权限管理 - 接口权限列表 API请求路径
 */
export const RoleApiApiUrl = {
  SelectApiWithRole: "Rbac/SelectApiWithRole",
  UpdateApi: "Rbac/UpdateApi",
  DeleteApi: "Rbac/DeleteApi",
  AddApiToRole: "Rbac/AddApiToRole",
  DelApiFromRole: "Rbac/DelApiFromRole",
  RoleBindAllApi: "Rbac/AllAddApiToRole",
  RoleUnBindAllApi: "Rbac/AllDelApiFromRole",
}

export const RoleApiApi = {
  /** 获取接口权限列表 */
  SelectApiWithRole: (param: any) => {
    return Post(RoleApiApiUrl.SelectApiWithRole, param);
  },
  UpdateApi: (param: any) => {
    return Post(RoleApiApiUrl.UpdateApi, param);
  },
  /** 删除api */
  DeleteApi: (param: any) => {
    return Post(RoleApiApiUrl.DeleteApi, param);
  },
  /** 添加角色API权限 */
  AddApiToRole: (param: any) => {
    return Post(RoleApiApiUrl.AddApiToRole, param);
  },
  /** 删除角色API权限 */
  DelApiFromRole: (param: any) => {
    return Post(RoleApiApiUrl.DelApiFromRole, param);
  },
  /** 角色绑定全部接口 */
  RoleBindAllApi: (param: any) => {
    return Post(RoleApiApiUrl.RoleBindAllApi, param);
  },
  /** 角色解绑全部接口 */
  RoleUnBindAllApi: (param: any) => {
    return Post(RoleApiApiUrl.RoleUnBindAllApi, param);
  }
}